﻿<Window x:Class="LogicCircuit.DialogLedMatrix"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:lc="clr-namespace:LogicCircuit"
	xmlns:properties="clr-namespace:LogicCircuit.Properties"
	WindowStartupLocation="CenterOwner"
	Title="{x:Static properties:Resources.NameLedMatrix}"
	Style="{StaticResource DialogWindow}"
	MinWidth="320" MinHeight="320"
	FocusManager.FocusedElement="{Binding ElementName=type}"
>
	<Window.Resources>
		<Style TargetType="ComboBox" BasedOn="{StaticResource {x:Type ComboBox}}">
			<Setter Property="HorizontalAlignment" Value="Left"/>
		</Style>

		<Style x:Key="ShapeContainerStyle" TargetType="{x:Type ComboBoxItem}">
			<Setter Property="Padding" Value="4"/>
		</Style>

		<Style x:Key="ShapeStyle" TargetType="{x:Type Shape}">
			<Setter Property="Stroke" Value="Black"/>
			<Setter Property="StrokeThickness" Value="1"/>
			<Setter Property="Fill" Value="{StaticResource LedMatrixOff}"/>
			<Setter Property="Width" Value="15"/>
			<Setter Property="Height" Value="15"/>
		</Style>
	</Window.Resources>

	<lc:AutoGrid Margin="3">
		<Label Content="{x:Static properties:Resources.TitleType}"/>
		<lc:AutoWidthComboBox x:Name="type"
			ItemsSource="{x:Static lc:LedMatrixDescriptor.MatrixTypes}"
			SelectedItem="{Binding Path=MatrixType}"
			ToolTip="{x:Static properties:Resources.ToolTipLedMatrixType}"
		/>

		<Label Content="{x:Static properties:Resources.TitleCellShape}"/>
		<ComboBox Name="cellShape" SelectedIndex="{Binding Path=CellShape}">
			<ComboBoxItem Style="{StaticResource ShapeContainerStyle}"><Ellipse   Style="{StaticResource ShapeStyle}"/></ComboBoxItem>
			<ComboBoxItem Style="{StaticResource ShapeContainerStyle}"><Rectangle Style="{StaticResource ShapeStyle}"/></ComboBoxItem>
		</ComboBox>

		<Label Content="{x:Static properties:Resources.TitleRows}"/>
		<ComboBox Name="rows" ItemsSource="{x:Static lc:LedMatrixDescriptor.RowsRange}" SelectedItem="{Binding Path=Rows}"/>

		<Label Content="{x:Static properties:Resources.TitleColumns}"/>
		<ComboBox Name="columns" ItemsSource="{x:Static lc:LedMatrixDescriptor.ColumnsRange}" SelectedItem="{Binding Path=Columns}"/>

		<Label Content="{x:Static properties:Resources.TitleColors}"/>
		<ComboBox Name="colors" ItemsSource="{Binding Path=ColorRange}" SelectedItem="{Binding Path=Colors}"/>

		<Label Content="{x:Static properties:Resources.TitleDescription}"/>
		<TextBox Name="note" AcceptsReturn="True" Text="{Binding Path=Note}"/>

		<StackPanel Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom">
			<Button Content="{x:Static properties:Resources.TitleOK}" IsDefault="True" Click="ButtonOkClick"/>
			<Button Content="{x:Static properties:Resources.TitleCancel}" IsCancel="True"/>
		</StackPanel>
	</lc:AutoGrid>
</Window>
